package com.quarkus.filter;

import lombok.extern.slf4j.Slf4j;
import org.jboss.resteasy.reactive.server.ServerRequestFilter;

import javax.inject.Inject;
import javax.validation.Validator;
import javax.ws.rs.container.ContainerRequestContext;

/**
 * @version v1.0
 * @Description: Request & Response Filter
 * @Author: TongRui乀
 * @Date: 2021/1/24 2:59 下午
 */
@Slf4j
public class RestServiceFilter {

    @Inject
    Validator validator;

    @ServerRequestFilter(preMatching = true)
    public void preMatchingFilter(ContainerRequestContext requestContext) {
        log.info("Request Filter method:{}, path:{}, mediaType:{}", requestContext.getMethod(), requestContext.getUriInfo().getPath(), requestContext.getHeaderString("Content-Type"));

        // 校验参数
    }

}